package com.solution.admin.product.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.product.dao.ProductPropertyRelaDao;
import com.solution.admin.product.entity.ProductPropertyRelaEntity;
import com.solution.admin.product.service.ProductPropertyRelaService;
import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 商品属性关联service实现层
 * @author xu_cc
 * @date 2017-08-31 23:33:40
 */
@Service
public class ProductPropertyRelaServiceImpl extends BaseServiceImpl<ProductPropertyRelaEntity> implements ProductPropertyRelaService {

	/**
	 * 商品属性关联接口
	 */
	@Autowired
	private ProductPropertyRelaDao productPropertyRelaDao;

	protected BaseDao<ProductPropertyRelaEntity> getDao() {
		return this.productPropertyRelaDao;
	}

	/**
	 * 保存商品属性关联
	 * @param productPropertyRelaEntity 商品属性关联实体
	 * @return Long 添加成功商品属性关联的ID
	 * @author xu_cc
	 * @date 2017-08-31 23:33:40
	 */
	public long saveProductPropertyRela(ProductPropertyRelaEntity productPropertyRelaEntity) {
		return productPropertyRelaDao.saveProductPropertyRela(productPropertyRelaEntity);
	}
	/**
	 * 删除商品属性关联
	 * @param 
	 * @return int 返回删除记录条数
	 * @author xu_cc
	 * @date 2017-08-31 23:33:40
	 */
	public int deleteProductPropertyRelaById(long id){
		return  productPropertyRelaDao.deleteById(id);
	}

    @Override
    public List<ProductPropertyRelaEntity> listProductPropertyRela(Long productId) {
        return  productPropertyRelaDao.listProductPropertyRela(productId);
    }
	
}
